home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98c.txt
/
000049_icon-group-sender _Thu Sep 24 12:40:48 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id MAA05485
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Thu, 24 Sep 1998 12:40:42 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA14498; Thu, 24 Sep 1998 12:40:09 -0700
Date: Thu, 24 Sep 1998 08:43:34 -0700
From: swampler@noao.edu (Steve Wampler)
Subject: Re: Possible to return a record from a loadable C func?
To: sch@southeast.net
Cc: icon-group@optima.CS.Arizona.EDU
Message-Id: <swampler-9808241543.AA003129436@orpheus.gemini.edu>
In-Reply-To: <6ucfk5$fh7@news.southeast.net>
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Hi Todd - Writing a C function to return an Icon record type is possible
(*anything* is possible), but not easy. If the record is defined
somewhere in the Icon code, it gets a little easier, as the run-time
system will know about the constructor. Is that how you intend to
use it, or were you thinking about being able to return a record
whose definition is unknown to Icon before the C function is
called?
If it's the 'simpler' of the two cases, have you written C functions
that return other Icon values (non-records) before? How about
that return an aggragrete (set/table/list)? I suspect you will much
better off if you've done both of these already, as most of the
fundamental operations will be familar to you and you can
concentrate on the record-specific stuff...
I've never done what you need, so cannot offer anything concrete,
but the basic steps would be:
(1) call the record constructor to allocate storage for the record (you will
probably have to wade through a fair amount of the runtime source
code to see how to do this...). The record constructor routine will
handle most of the tough stuff for you.
(2) fill in the fields with Icon values
(3) return the record using the C-to-Icon function return support.
Sorry this is so vague!
If you want to *define* the record type (i.e. there is no "record" expression for that
type in the Icon code), you're on your own - that strikes me a *much* harder
problem.
--
Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)]
The gods that smiled at your birth are now laughing openly. (Fortune Cookie)